﻿@using VirtualPress.Infrastructure.Entities.Entity;
@{Periodical data = ViewBag.Journal;}
@{
    ViewBag.Title = "期刊编辑 -- "+data.Name;
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
<div id="content-header">
    <h1>
        新增期刊</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/Home" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a
        href="/WorkSpace/console/baseinfo">期刊管理</a> 
        <a class="current">期刊基础信息</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-pencil"></i></span>
                    <h5>
                        期刊编辑</h5>
                    <h5 style="float:right;color:Red;">*为必填</h5>
                </div>
                <div class="widget-content nopadding">
                    <form id="form-wizard" class="form-horizontal" method="post" enctype="multipart/form-data" action="/WorkSpace/Console/BaseInfoEdit">
                    <input type="hidden" name="Id" value="@data.Id" />
                    <div id="form-wizard-1" class="step">
                        <div class="control-group">
                            <label class="control-label">
                                期刊名称 (*)</label>
                            <div class="controls">
                                <input id="name" type="text" name="Name" readonly="readonly" value="@data.Name" class="{ required: true, minlength: 2, maxlength: 128, normalchat: true }"/>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                英文名称 (*)</label>
                            <div class="controls">
                                <input id="ename" type="text" name="Name_EN" value="@data.Name_EN" class="{ required: true, minlength: 2, maxlength: 256, en: true}" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                期刊缩写 (*)</label>
                            <div class="controls">
                                <input id="shortname" type="text" name="ShortName" readonly="readonly" value="@data.ShortName" class="{ required: true, minlength: 2, maxlength: 128 }"  />
                                <label>* 用于期刊稿件编号，请认真填写</label>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                管理员账号 (*)</label>
                            <div class="controls">
                                @data.Admin
                                <input id="txtusername" type="hidden" name="Admin" value="@data.Admin" class="{ required: true, email: true }"/>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                行业分类 (*)</label>
                            <div class="controls">
                                <select id="sltIndType" name="IndType">
                                </select>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                出版周期 (*)</label>
                            <div class="controls">
                                <select id="sltPubRate" name="PubRateOption">
                                    <option value="半月刊">半月刊</option>
                                    <option value="月刊">月刊</option>
                                    <option value="季刊">季刊</option>
                                    <option value="半年刊">半年刊</option>
                                    <option value="年刊">年刊</option>
                                    <option value="其他">其他</option>
                                </select>
                                <input id="txtPubRate" type="text" name="pubRate" 
                                    style="width:200px;display:none;" value="半月刊" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                创刊日期 (*)</label>
                            <div id="datetimepicker" class="input-append controls" style="display:block;">
                                <input id="txtFoundTime" data-format="yyyy-MM-dd" type="text" name="foundTime"
                                    style="width:200px;" class="{ required: true, dateISO: true }" value="@data.FoundTime.ToString("yyyy-MM-dd")" />
                                <span class="add-on">
                                    <i class="icon-calendar" data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
                                </span>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                SSN Print</label>
                            <div class="controls">
                                <input id="txtISSNPrint" type="text" name="ISSN_Print" value="@data.ISSN_Print" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                ISSN Online</label>
                            <div class="controls">
                                <input id="txtISSNOnline" type="text" name="ISSN_Online" value="@data.ISSN_Online" />
                            </div>
                        </div>
                    </div>
                    <div id="form-wizard-2" class="step">
                        <div class="control-group">
                            <label class="control-label">
                                主办单位 (*)</label>
                            <div class="controls">
                                <textarea rows="3" id="tarZBDW" name="ZBDW" class="{required:true}">@data.ZBDW</textarea>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                协办单位</label>
                            <div class="controls">
                                <input id="txtXBDW" type="text" name="XBDW" value="@data.XBDW"  />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                出版单位</label>
                            <div class="controls">
                                <input id="txtCBDW" type="text" name="CBDW" value="@data.CBDW" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                期刊主编 (*)</label>
                            <div class="controls">
                                <input id="txtEditor" type="text" name="Editor" class="{required:true}" value="@data.Editor" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                高级顾问</label>
                            <div class="controls">
                                <input id="txtGJGW" type="text" name="GJGW" value="@data.GJGW" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                主持单位</label>
                            <div class="controls">
                                <input id="txtZCDW" type="text" name="ZCDW" value="@data.ZCDW" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                主管单位</label>
                            <div class="controls">
                                <input id="txtZGDW" type="text" name="ZGDW" value="@data.ZGDW" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                编审顾问</label>
                            <div class="controls">
                                <input id="txtBSGW" type="text" name="BSGW" value="@data.BSGW" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                国内统一连续出版物号</label>
                            <div class="controls">
                                <input id="txtGNTYLXCBWH" type="text" name="GNTYLXCBWH" value="@data.GNTYLXCBWH" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                国际标准连续出版物号</label>
                            <div class="controls">
                                <input id="txtGJBZLXCBWH_EN" type="text" name="GJBZLXCBWH_EN" value="@data.GJBZLXCBWH" />
                            </div>
                        </div>   
                        <div class="control-group">
                            <label class="control-label">
                                发行范围</label>
                            <div class="controls">
                                <input id="txtRange" type="text" name="Range" value="@data.Range"/>
                            </div>
                        </div>     
                        <div class="control-group">
                            <label class="control-label">
                                邮发代号</label>
                            <div class="controls">
                                <input id="txtYFDH" type="text" name="YFDH" value="@data.YFDH"/>
                            </div>
                        </div>   
                    </div>
                    <div id="form-wizard-3" class="step">  
                        <div class="control-group">
                            <label class="control-label">
                                期刊邮箱 (*)</label>
                            <div class="controls">
                                <input id="txtEmail" type="text" name="Email" class="{required:true,email:true}" value="@data.Email" />
                            </div>
                        </div>       
                        <div class="control-group">
                            <label class="control-label">
                                期刊封面 (*)</label>
                            <div class="controls">
                               <input id="txtCoverImg" type="file" name="CoverImg"    /> 
                               @if (!String.IsNullOrEmpty(data.CoverImg))
                               {
                                   <img alt="@data.Name" src="@data.CoverImg" style="width:90px;height:110px;" /> 
                               }
                            </div>
                        </div> 
                    </div>
                    <div class="form-actions">
                        <a class="btn btn-primary" href="/workspace/home/index">返回</a>
                        <input id="next" class="btn btn-primary" type="submit" />
                        <div id="status">
                        </div>
                    </div>
                    <div id="submitted">
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section tail
{
    <script type="text/javascript" src="/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/scripts/unicorn.wizard.js"></script>
    <script type="text/javascript" src="/scripts/jquery.metadata.js"></script>
    <script type="text/javascript" src="/scripts/jquery.wizard.js"></script>
    <script type="text/javascript" src="/Scripts/plug.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likjournalmanage').addClass('open active');
            $('#sltPubRate').change(function () {
                if ($(this).val() == '其他') {
                    $('#txtPubRate').show();
                }
                else {
                    $('#txtPubRate').hide();
                }
                $('#txtPubRate').val($(this).val());
            });
            new plug.Control().BuildSelect({ element: 'sltIndType' }, 'profession');
            $('#sltIndType').val(@((int)data.IndType));
            $('#sltPubRate').val('@data.PubRate');
            $('#txtPubRate').val('@data.PubRate');
        });
    </script>
}
